using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Dal.Entities;

namespace Dal.Mapping
{
	public class DocCommonMap : EntityTypeConfiguration<DocCommon>
	{
		public DocCommonMap()
		{
			// Primary Key
			this.HasKey(t => t.DocID);

			// Properties
			this.Property(t => t.DocID)
				.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
				
			this.Property(t => t.MedicalNumber_2)
				.HasMaxLength(50);
				
			this.Property(t => t.DoctorName)
				.HasMaxLength(50);
				
			this.Property(t => t.SubjectName)
				.HasMaxLength(50);
				
			this.Property(t => t.DoctorMobile)
				.HasMaxLength(50);
				
			this.Property(t => t.HospitalName)
				.HasMaxLength(50);
				
			this.Property(t => t.SubjectName_Other)
				.HasMaxLength(50);
				
			// Table & Column Mappings
			this.ToTable("DocCommon");
			this.Property(t => t.DocID).HasColumnName("DocID");
			this.Property(t => t.InputTime).HasColumnName("InputTime");
			this.Property(t => t.MedicalNumber_2).HasColumnName("MedicalNumber_2");
			this.Property(t => t.DoctorName).HasColumnName("DoctorName");
			this.Property(t => t.SubjectName).HasColumnName("SubjectName");
			this.Property(t => t.DoctorMobile).HasColumnName("DoctorMobile");
			this.Property(t => t.HospitalName).HasColumnName("HospitalName");
			this.Property(t => t.SubjectName_Other).HasColumnName("SubjectName_Other");
			this.Property(t => t.StatusAudit).HasColumnName("StatusAudit");
			this.Property(t => t.StatusComplete).HasColumnName("StatusComplete");
		}
	}
}

